\(\int \frac {A+B \log (e (a+b x)^n (c+d x)^{-n})}{(g+h x)^2} \, dx\) [299]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [B] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F(-1)]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 31, antiderivative size = 120 \[ \int \frac {A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{(g+h x)^2} \, dx=\frac {b B n \log (a+b x)}{h (b g-a h)}-\frac {B d n \log (c+d x)}{h (d g-c h)}-\frac {A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{h (g+h x)}+\frac {B (b c-a d) n \log (g+h x)}{(b g-a h) (d g-c h)} \]

[Out]

b*B*n*ln(b*x+a)/h/(-a*h+b*g)-B*d*n*ln(d*x+c)/h/(-c*h+d*g)+(-A-B*ln(e*(b*x+a)^n/((d*x+c)^n)))/h/(h*x+g)+B*(-a*d
+b*c)*n*ln(h*x+g)/(-a*h+b*g)/(-c*h+d*g)

Rubi [A] (verified)

Time = 0.08 (sec) , antiderivative size = 120, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.065, Rules used = {2548, 84} \[ \int \frac {A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{(g+h x)^2} \, dx=-\frac {B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+A}{h (g+h x)}+\frac {B n (b c-a d) \log (g+h x)}{(b g-a h) (d g-c h)}+\frac {b B n \log (a+b x)}{h (b g-a h)}-\frac {B d n \log (c+d x)}{h (d g-c h)} \]

[In]

Int[(A + B*Log[(e*(a + b*x)^n)/(c + d*x)^n])/(g + h*x)^2,x]

[Out]

(b*B*n*Log[a + b*x])/(h*(b*g - a*h)) - (B*d*n*Log[c + d*x])/(h*(d*g - c*h)) - (A + B*Log[(e*(a + b*x)^n)/(c +
d*x)^n])/(h*(g + h*x)) + (B*(b*c - a*d)*n*Log[g + h*x])/((b*g - a*h)*(d*g - c*h))

Rule 84

Int[((e_.) + (f_.)*(x_))^(p_.)/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Int[ExpandIntegrand[(
e + f*x)^p/((a + b*x)*(c + d*x)), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && IntegerQ[p]

Rule 2548

Int[((A_.) + Log[(e_.)*((a_.) + (b_.)*(x_))^(n_.)*((c_.) + (d_.)*(x_))^(mn_)]*(B_.))*((f_.) + (g_.)*(x_))^(m_.
), x_Symbol] :> Simp[(f + g*x)^(m + 1)*((A + B*Log[e*((a + b*x)^n/(c + d*x)^n)])/(g*(m + 1))), x] - Dist[B*n*(
(b*c - a*d)/(g*(m + 1))), Int[(f + g*x)^(m + 1)/((a + b*x)*(c + d*x)), x], x] /; FreeQ[{a, b, c, d, e, f, g, A
, B, m, n}, x] && EqQ[n + mn, 0] && NeQ[b*c - a*d, 0] && NeQ[m, -1] &&  !(EqQ[m, -2] && IntegerQ[n])

Rubi steps \begin{align*} \text {integral}& = -\frac {A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{h (g+h x)}+\frac {(B (b c-a d) n) \int \frac {1}{(a+b x) (c+d x) (g+h x)} \, dx}{h} \\ & = -\frac {A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{h (g+h x)}+\frac {(B (b c-a d) n) \int \left (\frac {b^2}{(b c-a d) (b g-a h) (a+b x)}+\frac {d^2}{(b c-a d) (-d g+c h) (c+d x)}+\frac {h^2}{(b g-a h) (d g-c h) (g+h x)}\right ) \, dx}{h} \\ & = \frac {b B n \log (a+b x)}{h (b g-a h)}-\frac {B d n \log (c+d x)}{h (d g-c h)}-\frac {A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{h (g+h x)}+\frac {B (b c-a d) n \log (g+h x)}{(b g-a h) (d g-c h)} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.11 (sec) , antiderivative size = 117, normalized size of antiderivative = 0.98 \[ \int \frac {A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{(g+h x)^2} \, dx=\frac {-\frac {A}{g+h x}-\frac {B \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{g+h x}+\frac {B n (b (d g-c h) \log (a+b x)+(-b d g+a d h) \log (c+d x)+(b c-a d) h \log (g+h x))}{(b g-a h) (d g-c h)}}{h} \]

[In]

Integrate[(A + B*Log[(e*(a + b*x)^n)/(c + d*x)^n])/(g + h*x)^2,x]

[Out]

(-(A/(g + h*x)) - (B*Log[(e*(a + b*x)^n)/(c + d*x)^n])/(g + h*x) + (B*n*(b*(d*g - c*h)*Log[a + b*x] + (-(b*d*g
) + a*d*h)*Log[c + d*x] + (b*c - a*d)*h*Log[g + h*x]))/((b*g - a*h)*(d*g - c*h)))/h

Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(367\) vs. \(2(122)=244\).

Time = 8.52 (sec) , antiderivative size = 368, normalized size of antiderivative = 3.07

method result size
parallelrisch \(\frac {A x a b c d \,g^{2} n -A x \,a^{2} c d g h n +B \ln \left (b x +a \right ) a^{2} c d \,g^{2} n^{2}-B \ln \left (b x +a \right ) a b \,c^{2} g^{2} n^{2}-B \ln \left (h x +g \right ) a^{2} c d \,g^{2} n^{2}+B \ln \left (h x +g \right ) a b \,c^{2} g^{2} n^{2}-B \ln \left (e \left (b x +a \right )^{n} \left (d x +c \right )^{-n}\right ) a^{2} c^{2} g h n +B \ln \left (e \left (b x +a \right )^{n} \left (d x +c \right )^{-n}\right ) a b \,c^{2} g^{2} n -B x \ln \left (e \left (b x +a \right )^{n} \left (d x +c \right )^{-n}\right ) a^{2} c d g h n +B x \ln \left (e \left (b x +a \right )^{n} \left (d x +c \right )^{-n}\right ) a b c d \,g^{2} n +B \ln \left (b x +a \right ) x \,a^{2} c d g h \,n^{2}-B \ln \left (b x +a \right ) x a b \,c^{2} g h \,n^{2}-B \ln \left (h x +g \right ) x \,a^{2} c d g h \,n^{2}+B \ln \left (h x +g \right ) x a b \,c^{2} g h \,n^{2}-A x a b \,c^{2} g h n +A x \,a^{2} c^{2} h^{2} n}{\left (a h -b g \right ) \left (h x +g \right ) n \left (c h -d g \right ) a c g}\) \(368\)
risch \(\text {Expression too large to display}\) \(1796\)

[In]

int((A+B*ln(e*(b*x+a)^n/((d*x+c)^n)))/(h*x+g)^2,x,method=_RETURNVERBOSE)

[Out]

(A*x*a*b*c*d*g^2*n-A*x*a^2*c*d*g*h*n+B*ln(b*x+a)*a^2*c*d*g^2*n^2-B*ln(b*x+a)*a*b*c^2*g^2*n^2-B*ln(h*x+g)*a^2*c
*d*g^2*n^2+B*ln(h*x+g)*a*b*c^2*g^2*n^2-B*ln(e*(b*x+a)^n/((d*x+c)^n))*a^2*c^2*g*h*n+B*ln(e*(b*x+a)^n/((d*x+c)^n
))*a*b*c^2*g^2*n-B*x*ln(e*(b*x+a)^n/((d*x+c)^n))*a^2*c*d*g*h*n+B*x*ln(e*(b*x+a)^n/((d*x+c)^n))*a*b*c*d*g^2*n+B
*ln(b*x+a)*x*a^2*c*d*g*h*n^2-B*ln(b*x+a)*x*a*b*c^2*g*h*n^2-B*ln(h*x+g)*x*a^2*c*d*g*h*n^2+B*ln(h*x+g)*x*a*b*c^2
*g*h*n^2-A*x*a*b*c^2*g*h*n+A*x*a^2*c^2*h^2*n)/(a*h-b*g)/(h*x+g)/n/(c*h-d*g)/a/c/g

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 250 vs. \(2 (120) = 240\).

Time = 3.58 (sec) , antiderivative size = 250, normalized size of antiderivative = 2.08 \[ \int \frac {A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{(g+h x)^2} \, dx=-\frac {A b d g^{2} + A a c h^{2} - {\left (A b c + A a d\right )} g h - {\left ({\left (B b d g h - B b c h^{2}\right )} n x + {\left (B a d g h - B a c h^{2}\right )} n\right )} \log \left (b x + a\right ) + {\left ({\left (B b d g h - B a d h^{2}\right )} n x + {\left (B b c g h - B a c h^{2}\right )} n\right )} \log \left (d x + c\right ) - {\left ({\left (B b c - B a d\right )} h^{2} n x + {\left (B b c - B a d\right )} g h n\right )} \log \left (h x + g\right ) + {\left (B b d g^{2} + B a c h^{2} - {\left (B b c + B a d\right )} g h\right )} \log \left (e\right )}{b d g^{3} h + a c g h^{3} - {\left (b c + a d\right )} g^{2} h^{2} + {\left (b d g^{2} h^{2} + a c h^{4} - {\left (b c + a d\right )} g h^{3}\right )} x} \]

[In]

integrate((A+B*log(e*(b*x+a)^n/((d*x+c)^n)))/(h*x+g)^2,x, algorithm="fricas")

[Out]

-(A*b*d*g^2 + A*a*c*h^2 - (A*b*c + A*a*d)*g*h - ((B*b*d*g*h - B*b*c*h^2)*n*x + (B*a*d*g*h - B*a*c*h^2)*n)*log(
b*x + a) + ((B*b*d*g*h - B*a*d*h^2)*n*x + (B*b*c*g*h - B*a*c*h^2)*n)*log(d*x + c) - ((B*b*c - B*a*d)*h^2*n*x +
 (B*b*c - B*a*d)*g*h*n)*log(h*x + g) + (B*b*d*g^2 + B*a*c*h^2 - (B*b*c + B*a*d)*g*h)*log(e))/(b*d*g^3*h + a*c*
g*h^3 - (b*c + a*d)*g^2*h^2 + (b*d*g^2*h^2 + a*c*h^4 - (b*c + a*d)*g*h^3)*x)

Sympy [F(-1)]

Timed out. \[ \int \frac {A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{(g+h x)^2} \, dx=\text {Timed out} \]

[In]

integrate((A+B*ln(e*(b*x+a)**n/((d*x+c)**n)))/(h*x+g)**2,x)

[Out]

Timed out

Maxima [A] (verification not implemented)

none

Time = 0.20 (sec) , antiderivative size = 151, normalized size of antiderivative = 1.26 \[ \int \frac {A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{(g+h x)^2} \, dx=\frac {{\left (\frac {b e n \log \left (b x + a\right )}{b g h - a h^{2}} - \frac {d e n \log \left (d x + c\right )}{d g h - c h^{2}} - \frac {{\left (b c e n - a d e n\right )} \log \left (h x + g\right )}{{\left (d g h - c h^{2}\right )} a - {\left (d g^{2} - c g h\right )} b}\right )} B}{e} - \frac {B \log \left (\frac {{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right )}{h^{2} x + g h} - \frac {A}{h^{2} x + g h} \]

[In]

integrate((A+B*log(e*(b*x+a)^n/((d*x+c)^n)))/(h*x+g)^2,x, algorithm="maxima")

[Out]

(b*e*n*log(b*x + a)/(b*g*h - a*h^2) - d*e*n*log(d*x + c)/(d*g*h - c*h^2) - (b*c*e*n - a*d*e*n)*log(h*x + g)/((
d*g*h - c*h^2)*a - (d*g^2 - c*g*h)*b))*B/e - B*log((b*x + a)^n*e/(d*x + c)^n)/(h^2*x + g*h) - A/(h^2*x + g*h)

Giac [A] (verification not implemented)

none

Time = 0.37 (sec) , antiderivative size = 169, normalized size of antiderivative = 1.41 \[ \int \frac {A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{(g+h x)^2} \, dx=\frac {B b^{2} n \log \left ({\left | b x + a \right |}\right )}{b^{2} g h - a b h^{2}} - \frac {B d^{2} n \log \left ({\left | -d x - c \right |}\right )}{d^{2} g h - c d h^{2}} - \frac {B n \log \left (b x + a\right )}{h^{2} x + g h} + \frac {B n \log \left (d x + c\right )}{h^{2} x + g h} + \frac {{\left (B b c n - B a d n\right )} \log \left (h x + g\right )}{b d g^{2} - b c g h - a d g h + a c h^{2}} - \frac {B \log \left (e\right ) + A}{h^{2} x + g h} \]

[In]

integrate((A+B*log(e*(b*x+a)^n/((d*x+c)^n)))/(h*x+g)^2,x, algorithm="giac")

[Out]

B*b^2*n*log(abs(b*x + a))/(b^2*g*h - a*b*h^2) - B*d^2*n*log(abs(-d*x - c))/(d^2*g*h - c*d*h^2) - B*n*log(b*x +
 a)/(h^2*x + g*h) + B*n*log(d*x + c)/(h^2*x + g*h) + (B*b*c*n - B*a*d*n)*log(h*x + g)/(b*d*g^2 - b*c*g*h - a*d
*g*h + a*c*h^2) - (B*log(e) + A)/(h^2*x + g*h)

Mupad [B] (verification not implemented)

Time = 1.46 (sec) , antiderivative size = 141, normalized size of antiderivative = 1.18 \[ \int \frac {A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{(g+h x)^2} \, dx=\frac {B\,d\,n\,\ln \left (c+d\,x\right )}{c\,h^2-d\,g\,h}-\frac {\ln \left (g+h\,x\right )\,\left (B\,a\,d\,n-B\,b\,c\,n\right )}{a\,c\,h^2+b\,d\,g^2-a\,d\,g\,h-b\,c\,g\,h}-\frac {B\,\ln \left (\frac {e\,{\left (a+b\,x\right )}^n}{{\left (c+d\,x\right )}^n}\right )}{h\,\left (g+h\,x\right )}-\frac {B\,b\,n\,\ln \left (a+b\,x\right )}{a\,h^2-b\,g\,h}-\frac {A}{x\,h^2+g\,h} \]

[In]

int((A + B*log((e*(a + b*x)^n)/(c + d*x)^n))/(g + h*x)^2,x)

[Out]

(B*d*n*log(c + d*x))/(c*h^2 - d*g*h) - (log(g + h*x)*(B*a*d*n - B*b*c*n))/(a*c*h^2 + b*d*g^2 - a*d*g*h - b*c*g
*h) - (B*log((e*(a + b*x)^n)/(c + d*x)^n))/(h*(g + h*x)) - (B*b*n*log(a + b*x))/(a*h^2 - b*g*h) - A/(g*h + h^2
*x)